<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateEmployerBalance extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('employer_balance', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedInteger('user_id')->default(0)->comment('用户id');
            $table->unsignedInteger('cooperative_id')->default(0)->comment('合作商id');
            $table->unsignedTinyInteger('account_type')->default(0)->comment('账目类型：1充值，2发布任务扣款，3任务申请退款');
            $table->decimal('money', 10, 2)->default(0.00)->comment('金额');
            $table->string('detail', 255)->default('')->comment('描述');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('employer_balance');
    }
}
